home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / man / man.n / canvas.n < prev    next >
Text File  |  1995-07-21  |  65KB  |  1,653 lines

  1. '\"
  2. '\" Copyright (c) 1992 The Regents of the University of California.
  3. '\" All rights reserved.
  4. '\"
  5. '\" Permission is hereby granted, without written agreement and without
  6. '\" license or royalty fees, to use, copy, modify, and distribute this
  7. '\" documentation for any purpose, provided that the above copyright
  8. '\" notice and the following two paragraphs appear in all copies.
  9. '\"
  10. '\" IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY
  11. '\" FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
  12. '\" ARISING OUT OF THE USE OF THIS DOCUMENTATION, EVEN IF THE UNIVERSITY OF
  13. '\" CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  14. '\"
  15. '\" THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
  16. '\" INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
  17. '\" AND FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
  18. '\" ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO
  19. '\" PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
  20. '\" 
  21. '\" $Header: /user6/ouster/wish/man/RCS/canvas.n,v 1.19 93/08/06 11:11:03 ouster Exp $ SPRITE (Berkeley)
  22. '/"
  23. .\" The definitions below are for supplemental macros used in Tcl/Tk
  24. .\" manual entries.
  25. .\"
  26. .\" .HS name section [date [version]]
  27. .\"    Replacement for .TH in other man pages.  See below for valid
  28. .\"    section names.
  29. .\"
  30. .\" .AP type name in/out [indent]
  31. .\"    Start paragraph describing an argument to a library procedure.
  32. .\"    type is type of argument (int, etc.), in/out is either "in", "out",
  33. .\"    or "in/out" to describe whether procedure reads or modifies arg,
  34. .\"    and indent is equivalent to second arg of .IP (shouldn't ever be
  35. .\"    needed;  use .AS below instead)
  36. .\"
  37. .\" .AS [type [name]]
  38. .\"    Give maximum sizes of arguments for setting tab stops.  Type and
  39. .\"    name are examples of largest possible arguments that will be passed
  40. .\"    to .AP later.  If args are omitted, default tab stops are used.
  41. .\"
  42. .\" .BS
  43. .\"    Start box enclosure.  From here until next .BE, everything will be
  44. .\"    enclosed in one large box.
  45. .\"
  46. .\" .BE
  47. .\"    End of box enclosure.
  48. .\"
  49. .\" .VS
  50. .\"    Begin vertical sidebar, for use in marking newly-changed parts
  51. .\"    of man pages.
  52. .\"
  53. .\" .VE
  54. .\"    End of vertical sidebar.
  55. .\"
  56. .\" .DS
  57. .\"    Begin an indented unfilled display.
  58. .\"
  59. .\" .DE
  60. .\"    End of indented unfilled display.
  61. .\"
  62. '\"    # Heading for Tcl/Tk man pages
  63. .de HS
  64. .ds ^3 \\0
  65. .if !"\\$3"" .ds ^3 \\$3
  66. .if '\\$2'cmds'       .TH \\$1 1 \\*(^3 \\$4
  67. .if '\\$2'lib'        .TH \\$1 3 \\*(^3 \\$4
  68. .if '\\$2'tcl'        .TH \\$1 n \\*(^3 Tcl "Tcl Built-In Commands"
  69. .if '\\$2'tk'         .TH \\$1 n \\*(^3 Tk "Tk Commands"
  70. .if '\\$2'tclc'        .TH \\$1 3 \\*(^3 Tcl "Tcl Library Procedures"
  71. .if '\\$2'tkc'         .TH \\$1 3 \\*(^3 Tk "Tk Library Procedures"
  72. .if '\\$2'tclcmds'         .TH \\$1 1 \\*(^3 Tk "Tcl Applications"
  73. .if '\\$2'tkcmds'         .TH \\$1 1 \\*(^3 Tk "Tk Applications"
  74. .if t .wh -1.3i ^B
  75. .nr ^l \\n(.l
  76. .ad b
  77. ..
  78. '\"    # Start an argument description
  79. .de AP
  80. .ie !"\\$4"" .TP \\$4
  81. .el \{\
  82. .   ie !"\\$2"" .TP \\n()Cu
  83. .   el          .TP 15
  84. .\}
  85. .ie !"\\$3"" \{\
  86. .ta \\n()Au \\n()Bu
  87. \&\\$1    \\fI\\$2\\fP    (\\$3)
  88. .\".b
  89. .\}
  90. .el \{\
  91. .br
  92. .ie !"\\$2"" \{\
  93. \&\\$1    \\fI\\$2\\fP
  94. .\}
  95. .el \{\
  96. \&\\fI\\$1\\fP
  97. .\}
  98. .\}
  99. ..
  100. '\"    # define tabbing values for .AP
  101. .de AS
  102. .nr )A 10n
  103. .if !"\\$1"" .nr )A \\w'\\$1'u+3n
  104. .nr )B \\n()Au+15n
  105. .\"
  106. .if !"\\$2"" .nr )B \\w'\\$2'u+\\n()Au+3n
  107. .nr )C \\n()Bu+\\w'(in/out)'u+2n
  108. ..
  109. '\"    # BS - start boxed text
  110. '\"    # ^y = starting y location
  111. '\"    # ^b = 1
  112. .de BS
  113. .br
  114. .mk ^y
  115. .nr ^b 1u
  116. .if n .nf
  117. .if n .ti 0
  118. .if n \l'\\n(.lu\(ul'
  119. .if n .fi
  120. ..
  121. '\"    # BE - end boxed text (draw box now)
  122. .de BE
  123. .nf
  124. .ti 0
  125. .mk ^t
  126. .ie n \l'\\n(^lu\(ul'
  127. .el \{\
  128. .\"    Draw four-sided box normally, but don't draw top of
  129. .\"    box if the box started on an earlier page.
  130. .ie !\\n(^b-1 \{\
  131. \h'-1.5n'\L'|\\n(^yu-1v'\l'\\n(^lu+3n\(ul'\L'\\n(^tu+1v-\\n(^yu'\l'|0u-1.5n\(ul'
  132. .\}
  133. .el \}\
  134. \h'-1.5n'\L'|\\n(^yu-1v'\h'\\n(^lu+3n'\L'\\n(^tu+1v-\\n(^yu'\l'|0u-1.5n\(ul'
  135. .\}
  136. .\}
  137. .fi
  138. .br
  139. .nr ^b 0
  140. ..
  141. '\"    # VS - start vertical sidebar
  142. '\"    # ^Y = starting y location
  143. '\"    # ^v = 1 (for troff;  for nroff this doesn't matter)
  144. .de VS
  145. .mk ^Y
  146. .ie n 'mc \s12\(br\s0
  147. .el .nr ^v 1u
  148. ..
  149. '\"    # VE - end of vertical sidebar
  150. .de VE
  151. .ie n 'mc
  152. .el \{\
  153. .ev 2
  154. .nf
  155. .ti 0
  156. .mk ^t
  157. \h'|\\n(^lu+3n'\L'|\\n(^Yu-1v\(bv'\v'\\n(^tu+1v-\\n(^Yu'\h'-|\\n(^lu+3n'
  158. .sp -1
  159. .fi
  160. .ev
  161. .\}
  162. .nr ^v 0
  163. ..
  164. '\"    # Special macro to handle page bottom:  finish off current
  165. '\"    # box/sidebar if in box/sidebar mode, then invoked standard
  166. '\"    # page bottom macro.
  167. .de ^B
  168. .ev 2
  169. 'ti 0
  170. 'nf
  171. .mk ^t
  172. .if \\n(^b \{\
  173. .\"    Draw three-sided box if this is the box's first page,
  174. .\"    draw two sides but no top otherwise.
  175. .ie !\\n(^b-1 \h'-1.5n'\L'|\\n(^yu-1v'\l'\\n(^lu+3n\(ul'\L'\\n(^tu+1v-\\n(^yu'\h'|0u'\c
  176. .el \h'-1.5n'\L'|\\n(^yu-1v'\h'\\n(^lu+3n'\L'\\n(^tu+1v-\\n(^yu'\h'|0u'\c
  177. .\}
  178. .if \\n(^v \{\
  179. .nr ^x \\n(^tu+1v-\\n(^Yu
  180. \kx\h'-\\nxu'\h'|\\n(^lu+3n'\ky\L'-\\n(^xu'\v'\\n(^xu'\h'|0u'\c
  181. .\}
  182. .bp
  183. 'fi
  184. .ev
  185. .if \\n(^b \{\
  186. .mk ^y
  187. .nr ^b 2
  188. .\}
  189. .if \\n(^v \{\
  190. .mk ^Y
  191. .\}
  192. ..
  193. '\"    # DS - begin display
  194. .de DS
  195. .RS
  196. .nf
  197. .sp
  198. ..
  199. '\"    # DE - end display
  200. .de DE
  201. .fi
  202. .RE
  203. .sp .5
  204. ..
  205. .HS canvas tk
  206. .BS
  207. '\" Note:  do not modify the .SH NAME line immediately below!
  208. .SH NAME
  209. canvas \- Create and manipulate canvas widgets
  210. .SH SYNOPSIS
  211. \fBcanvas\fI \fIpathName \fR?\fIoptions\fR?
  212. .SH "STANDARD OPTIONS"
  213. .LP
  214. .nf
  215. .ta 4c 8c 12c
  216. \fBbackground\fR    \fBinsertBorderWidth\fR    \fBrelief\fR    \fBxScrollCommand\fR
  217. .VS
  218. \fBborderWidth\fR    \fBinsertOffTime\fR    \fBselectBackground\fR    \fByScrollCommand\fR
  219. \fBcursor\fR    \fBinsertOnTime\fR    \fBselectBorderWidth\fR
  220. \fBinsertBackground\fR    \fBinsertWidth\fR    \fBselectForeground\fR
  221. .VE
  222. .fi
  223. .LP
  224. See the ``options'' manual entry for details on the standard options.
  225. .SH "WIDGET-SPECIFIC OPTIONS"
  226. .ta 4c
  227. .LP
  228. .nf
  229. Name:    \fBcloseEnough\fR
  230. Class:    \fBCloseEnough\fR
  231. Command-Line Switch:    \fB\-closeenough\fR
  232. .fi
  233. .IP
  234. Specifies a floating-point value indicating how close the mouse cursor
  235. must be to an item before it is considered to be ``inside'' the item.
  236. Defaults to 1.0.
  237. .LP
  238. .nf
  239. .VS
  240. Name:    \fBconfine\fR
  241. Class:    \fBConfine\fR
  242. Command-Line Switch:    \fB\-confine\fR
  243. .fi
  244. .IP
  245. Specifies a boolean value that indicates whether or not it should be
  246. allowable to set the canvas's view outside the region defined by the
  247. \fBscrollRegion\fR argument.
  248. Defaults to true, which means that the view will
  249. be constrained within the scroll region.
  250. .VE
  251. .LP
  252. .nf
  253. Name:    \fBheight\fR
  254. Class:    \fBHeight\fR
  255. Command-Line Switch:    \fB\-height\fR
  256. .fi
  257. .IP
  258. Specifies a desired window height that the canvas widget should request from
  259. its geometry manager.  The value may be specified in any
  260. of the forms described in the COORDINATES section below.
  261. .LP
  262. .nf
  263. Name:    \fBscrollIncrement\fR
  264. Class:    \fBScrollIncrement\fR
  265. Command-Line Switch:    \fB\-scrollincrement\fR
  266. .fi
  267. .IP
  268. Specifies a distance used as increment during scrolling:  when one of
  269. the arrow buttons on an associated scrollbar is pressed, the picture
  270. will shift by this distance.  The distance may be specified in any
  271. of the forms described in the COORDINATES section below.
  272. .LP
  273. .nf
  274. Name:    \fBscrollRegion\fR
  275. Class:    \fBScrollRegion\fR
  276. Command-Line Switch:    \fB\-scrollregion\fR
  277. .fi
  278. .IP
  279. Specifies a list with four coordinates describing the left, top, right, and
  280. bottom coordinates of a rectangular region.
  281. This region is used for scrolling purposes and is considered to be
  282. the boundary of the information in the canvas.
  283. Each of the coordinates may be specified
  284. in any of the forms given in the COORDINATES section below.
  285. .LP
  286. .nf
  287. Name:    \fBwidth\fR
  288. Class:    \fBwidth\fR
  289. Command-Line Switch:    \fB\-width\fR
  290. .fi
  291. .IP
  292. Specifies a desired window width that the canvas widget should request from
  293. its geometry manager.  The value may be specified in any
  294. of the forms described in the COORDINATES section below.
  295. .BE
  296.  
  297. .SH INTRODUCTION
  298. .PP
  299. The \fBcanvas\fR command creates a new window (given
  300. by the \fIpathName\fR argument) and makes it into a canvas widget.
  301. Additional options, described above, may be specified on the
  302. command line or in the option database
  303. to configure aspects of the canvas such as its colors and 3-D relief.
  304. The \fBcanvas\fR command returns its
  305. \fIpathName\fR argument.  At the time this command is invoked,
  306. there must not exist a window named \fIpathName\fR, but
  307. \fIpathName\fR's parent must exist.
  308. .PP
  309. Canvas widgets implement structured graphics.
  310. A canvas displays any number of \fIitems\fR, which may be things like
  311. rectangles, circles, lines, and text.
  312. Items may be manipulated (e.g. moved or re-colored) and commands may
  313. be associated with items in much the same way that the \fBbind\fR
  314. command allows commands to be bound to widgets.  For example,
  315. a particular command may be associated with the <Button-1> event
  316. so that the command is invoked whenever button 1 is pressed with
  317. the mouse cursor over an item.
  318. This means that items in a canvas can have behaviors defined by
  319. the Tcl scripts bound to them.
  320.  
  321. .SH "DISPLAY LIST"
  322. .PP
  323. The items in a canvas are ordered for purposes of display,
  324. with the first item in the display list being displayed
  325. first, followed by the next item in the list, and so on.
  326. Items later in the display list obscure those that are
  327. earlier in the display list and are sometimes referred to
  328. as being ``on top'' of earlier items.
  329. When a new item is created it is placed at the end of the
  330. display list, on top of everything else.
  331. Widget commands may be used to re-arrange the order of the
  332. display list.
  333.  
  334. .SH "ITEM IDS AND TAGS"
  335. .PP
  336. Items in a canvas widget may be named in either of two ways:
  337. by id or by tag.
  338. Each item has a unique identifying number which is assigned to
  339. that item when it is created.  The id of an item never changes
  340. and id numbers are never re-used within the lifetime of a
  341. canvas widget.
  342. .PP
  343. Each item may also have any number of \fItags\fR associated
  344. with it.  A tag is just a string of characters, and it may
  345. take any form except that of an integer.
  346. For example, ``x123'' is OK but ``123'' isn't.
  347. The same tag may be associated with many different items.
  348. This is commonly done to group items in various interesting
  349. ways;  for example, all selected items might be given the
  350. tag ``selected''.
  351. .PP
  352. The tag \fBall\fR is implicitly associated with every item
  353. in the canvas;  it may be used to invoke operations on
  354. all the items in the canvas.
  355. .PP
  356. The tag \fBcurrent\fR is managed automatically by Tk;
  357. it applies to the \fIcurrent item\fR, which is the
  358. topmost item whose drawn area covers the position of
  359. the mouse cursor.
  360. If the mouse is not in the canvas widget or is not over
  361. an item, then no item has the \fBcurrent\fR tag.
  362. .PP
  363. When specifying items in canvas widget commands, if the
  364. specifier is an integer then it is assumed to refer to
  365. the single item with that id.
  366. If the specifier is not an integer, then it is assumed to
  367. refer to all of the items in the canvas that have a tag
  368. matching the specifier.
  369. The symbol \fItagOrId\fR is used below to indicate that
  370. an argument specifies either an id that selects a single
  371. item or a tag that selects zero or more items.
  372. Some widget commands only operate on a single item at a
  373. time;  if \fItagOrId\fR is specified in a way that
  374. names multiple items, then the normal behavior is for
  375. the command to use the first (lowest) of these items in
  376. the display list that is suitable for the command.
  377. Exceptions are noted in the widget command descriptions
  378. below.
  379.  
  380. .SH "COORDINATES"
  381. .PP
  382. All coordinates related to canvases are stored as floating-point
  383. numbers.
  384. Coordinates and distances are specified in screen units,
  385. which are floating-point numbers optionally followed
  386. by one of several letters.
  387. If no letter is supplied then the distance is in pixels.
  388. If the letter is \fBm\fR then the distance is in millimeters on
  389. the screen;  if it is \fBc\fR then the distance is in centimeters;
  390. \fBi\fR means inches, and \fBp\fR means printers points (1/72 inch).
  391. Larger y-coordinates refer to points lower on the screen;  larger
  392. x-coordinates refer to points farther to the right.
  393.  
  394. .SH TRANSFORMATIONS
  395. .PP
  396. Normally the origin of the canvas coordinate system is at the
  397. upper-left corner of the window containing the canvas.
  398. It is possible to adjust the origin of the canvas
  399. coordinate system relative to the origin of the window using the
  400. \fBxview\fR and \fByview\fR widget commands;  this is typically used
  401. for scrolling.
  402. Canvases do not support scaling or rotation of the canvas coordinate
  403. system relative to the window coordinate system.
  404. .PP
  405. Indidividual items may be moved or scaled using widget commands
  406. described below, but they may not be rotated.
  407.  
  408. .SH "INDICES"
  409. .PP
  410. Text items support the notion of an \fIindex\fR for identifying
  411. particular positions within the item.
  412. Indices are used for commands such as inserting text, deleting
  413. a range of characters, and setting the insertion cursor position.
  414. An index may be specified in any of a number of ways, and
  415. different types of items may support different forms for
  416. specifying indices.
  417. Text items support the following forms for an index;  if you
  418. define new types of text-like items, it would be advisable to
  419. support as many of these forms as practical.
  420. Note that it is possible to refer to the character just after
  421. the last one in the text item;  this is necessary for such
  422. tasks as inserting new text at the end of the item.
  423. .TP 10
  424. \fInumber\fR
  425. A decimal number giving the position of the desired character
  426. within the text item.
  427. 0 refers to the first character, 1 to the next character, and
  428. so on.
  429. A number less than 0 is treated as if it were zero, and a
  430. number greater than the length of the text item is treated
  431. as if it were equal to the length of the text item.
  432. .TP 10
  433. \fBend\fR
  434. Refers to the character just after the last one in the item
  435. (same as the number of characters in the item).
  436. .TP 10
  437. \fBinsert\fR
  438. .VS
  439. .VE
  440. Refers to the character just before which the insertion cursor
  441. is drawn in this item.
  442. .TP 10
  443. \fBsel.first\fR
  444. Refers to the first selected character in the item.
  445. If the selection isn't in this item then this form is illegal.
  446. .TP 10
  447. \fBsel.last\fR
  448. Refers to the last selected character in the item.
  449. If the selection isn't in this item then this form is illegal.
  450. .TP 10
  451. \fB@\fIx,y\fR
  452. Refers to the character at the point given by \fIx\fR and
  453. \fIy\fR, where \fIx\fR and \fIy\fR are specified in the coordinate
  454. system of the canvas.
  455. If \fIx\fR and \fIy\fR lie outside the coordinates covered by the
  456. text item, then they refer to the first or last character in the
  457. line that is closest to the given point.
  458.  
  459. .SH "WIDGET COMMAND"
  460. .PP
  461. The \fBcanvas\fR command creates a new Tcl command whose
  462. name is \fIpathName\fR.  This
  463. command may be used to invoke various
  464. operations on the widget.  It has the following general form:
  465. .DS C
  466. \fIpathName option \fR?\fIarg arg ...\fR?
  467. .DE
  468. \fIOption\fR and the \fIarg\fRs
  469. determine the exact behavior of the command.
  470. The following widget commands are possible for canvas widgets:
  471. .TP
  472. \fIpathName \fBaddtag \fItag searchSpec \fR?\fIarg arg ...\fR?
  473. For each item that meets the constraints specified by
  474. \fIsearchSpec\fR and the \fIarg\fRs, add
  475. \fItag\fR to the list of tags associated with the item if it
  476. isn't already present on that list.
  477. It is possible that no items will satisfy the constraints
  478. given by \fIsearchSpec and \fIarg\fRs, in which case the
  479. command has no effect.
  480. This command returns an empty string as result.
  481. \fISearchSpec\fR and \fIarg\fR's may take any of the following
  482. forms:
  483. .RS
  484. .TP
  485. \fBabove \fItagOrId\fR
  486. Selects the item just after (above) the one given by \fItagOrId\fR
  487. in the display list.
  488. If \fItagOrId\fR denotes more than one item, then the last (topmost)
  489. of these items in the display list is used.
  490. .TP
  491. \fBall\fR
  492. Selects all the items in the canvas.
  493. .TP
  494. \fBbelow \fItagOrId\fR
  495. Selects the item just before (below) the one given by \fItagOrId\fR
  496. in the display list.
  497. If \fItagOrId\fR denotes more than one item, then the first (lowest)
  498. of these items in the display list is used.
  499. .TP
  500. \fBclosest \fIx y \fR?\fIhalo\fR? ?\fIstart\fR?
  501. Selects the item closest to the point given by \fIx\fR and \fIy\fR.
  502. If more than one item is at the same closest distance (e.g. two
  503. items overlap the point), then the top-most of these items (the
  504. last one in the display list) is used.
  505. If \fIhalo\fR is specified, then it must be a non-negative
  506. value.
  507. Any item closer than \fIhalo\fR to the point is considered to
  508. overlap it.
  509. The \fIstart\fR argument may be used to step circularly through
  510. all the closest items.
  511. If \fIstart\fR is specified, it names an item using a tag or id
  512. (if by tag, it selects the first item in the display list with
  513. the given tag).
  514. Instead of selecting the topmost closest item, this form will
  515. select the topmost closest item that is below \fIstart\fR in
  516. the display list;  if no such item exists, then the selection
  517. behaves as if the \fIstart\fR argument had not been specified.
  518. .TP
  519. \fBenclosed\fR \fIx1\fR \fIy1\fR \fIx2\fR \fIy2\fR
  520. Selects all the items completely enclosed within the rectangular
  521. region given by \fIx1\fR, \fIy1\fR, \fIx2\fR, and \fIy2\fR.
  522. \fIX1\fR must be no greater then \fIx2\fR and \fIy1\fR must be
  523. no greater than \fIy2\fR.
  524. .TP
  525. \fBoverlapping\fR \fIx1\fR \fIy1\fR \fIx2\fR \fIy2\fR
  526. Selects all the items that overlap or are enclosed within the
  527. rectangular region given by \fIx1\fR, \fIy1\fR, \fIx2\fR,
  528. and \fIy2\fR.
  529. \fIX1\fR must be no greater then \fIx2\fR and \fIy1\fR must be
  530. no greater than \fIy2\fR.
  531. .TP
  532. \fBwithtag \fItagOrId\fR
  533. Selects all the items given by \fItagOrId\fR.
  534. .RE
  535. .TP
  536. \fIpathName \fBbbox \fItagOrId\fR ?\fItagOrId tagOrId ...\fR?
  537. .VS
  538. Returns a list with four elements giving an approximate bounding box
  539. for all the items named by the \fItagOrId\fR arguments.
  540. The list has the form ``\fIx1 y1 x2 y2\fR'' such that the drawn
  541. areas of all the named elements are within the region bounded by
  542. \fIx1\fR on the left, \fIx2\fR on the right, \fIy1\fR on the top,
  543. and \fIy2\fR on the bottom.
  544. The return value may overestimate the actual bounding box by
  545. a few pixels.
  546. If no items match any of the \fItagOrId\fR arguments then an
  547. empty string is returned.
  548. .VE
  549. .TP
  550. \fIpathName \fBbind \fItagOrId\fR ?\fIsequence\fR? ?\fIcommand\fR?
  551. This command associates \fIcommand\fR with all the items given by
  552. \fItagOrId\fR such that whenever the event sequence given by
  553. \fIsequence\fR occurs for one of the items the command will
  554. be invoked.
  555. This widget command is similar to the \fBbind\fR command except that
  556. it operates on items in a canvas rather than entire widgets.
  557. See the \fBbind\fR manual entry for complete details
  558. on the syntax of \fIsequence\fR and the substitutions performed
  559. on \fIcommand\fR before invoking it.
  560. If all arguments are specified then a new binding is created, replacing
  561. any existing binding for the same \fIsequence\fR and \fItagOrId\fR
  562. (if the first character of \fIcommand\fR is ``+'' then \fIcommand\fR
  563. augments an existing binding rather than replacing it).
  564. In this case the return value is an empty string.
  565. If \fIcommand\fR is omitted then the command returns the \fIcommand\fR
  566. associated with \fItagOrId\fR and \fIsequence\fR (an error occurs
  567. if there is no such binding).
  568. If both \fIcommand\fR and \fIsequence\fR are omitted then the command
  569. returns a list of all the sequences for which bindings have been
  570. defined for \fItagOrId\fR.
  571. .RS
  572. .LP
  573. The only events for which bindings may be specified are those related
  574. to the mouse and keyboard, such as \fBEnter\fR, \fBLeave\fR,
  575. \fBButtonPress\fR, \fBMotion\fR, and \fBKeyPress\fR.
  576. The handling of events in canvases uses the current item defined
  577. in ITEM IDS AND TAGS above.
  578. \fBEnter\fR and \fBLeave\fR events trigger for an item when it
  579. becomes the current item or ceases to be the current item;  note
  580. that these events are different than \fBEnter\fR and \fBLeave\fR
  581. events for windows.
  582. Mouse-related events are directed to the current item, if any.
  583. Keyboard-related events are directed to the focus item, if any
  584. (see the \fBfocus\fR widget command below for more on this).
  585. .LP
  586. It is possible for multiple commands to be bound to a single
  587. event sequence for a single object.
  588. This occurs, for example, if one command is associated with the
  589. item's id and another is associated with one of the item's tags.
  590. When this occurs, the first matching binding is used.
  591. A binding for the item's id has highest priority, followed by
  592. the oldest tag for the item and proceeding through all of the
  593. item's tags up through the most-recently-added one.
  594. If a binding is associated with the tag \fBall\fR, the binding
  595. will have lower priority than all other bindings associated
  596. with the item.
  597. .RE
  598. .TP
  599. \fIpathName \fBcanvasx \fIscreenx\fR ?\fIgridspacing\fR?
  600. Given a screen x-coordinate \fIscreenx\fR this command returns
  601. the canvas x-coordinate that is displayed at that location.
  602. If \fIgridspacing\fR is specified, then the canvas coordinate is
  603. rounded to the nearest multiple of \fIgridspacing\fR units.
  604. .TP
  605. \fIpathName \fBcanvasy \fIscreeny\fR ?\fIgridspacing\fR?
  606. Given a screen y-coordinate \fIscreeny\fR this command returns
  607. the canvas y-coordinate that is displayed at that location.
  608. If \fIgridspacing\fR is specified, then the canvas coordinate is
  609. rounded to the nearest multiple of \fIgridspacing\fR units.
  610. .TP
  611. \fIpathName \fBconfigure ?\fIoption\fR? ?\fIvalue\fR? ?\fIoption value ...\fR?
  612. Query or modify the configuration options of the widget.
  613. If no \fIoption\fR is specified, returns a list describing all of
  614. the available options for \fIpathName\fR (see \fBTk_ConfigureInfo\fR for
  615. information on the format of this list).  If \fIoption\fR is specified
  616. with no \fIvalue\fR, then the command returns a list describing the
  617. one named option (this list will be identical to the corresponding
  618. sublist of the value returned if no \fIoption\fR is specified).  If
  619. one or more \fIoption\-value\fR pairs are specified, then the command
  620. modifies the given widget option(s) to have the given value(s);  in
  621. this case the command returns an empty string.
  622. \fIOption\fR may have any of the values accepted by the \fBcanvas\fR
  623. command.
  624. .TP
  625. \fIpathName\fR \fBcoords \fItagOrId \fR?\fIx0 y0 ...\fR?
  626. .VS
  627. Query or modify the coordinates that define an item.
  628. If no coordinates are specified, this command returns a list
  629. whose elements are the coordinates of the item named by
  630. \fItagOrId\fR.
  631. If coordinates are specified, then they replace the current
  632. coordinates for the named item.
  633. If \fItagOrId\fR refers to multiple items, then
  634. the first one in the display list is used.
  635. .VE
  636. .TP
  637. \fIpathName \fBcreate \fItype x y \fR?\fIx y ...\fR? ?\fIoption value ...\fR?
  638. Create a new item in \fIpathName\fR of type \fItype\fR.
  639. The exact format of the arguments after \fBtype\fR depends
  640. on \fBtype\fR, but usually they consist of the coordinates for
  641. one or more points, followed by specifications for zero or
  642. more item options.
  643. See the subsections on individual item types below for more
  644. on the syntax of this command.
  645. This command returns the id for the new item.
  646. .TP
  647. \fIpathName \fBdchars \fItagOrId first \fR?\fIlast\fR?
  648. For each item given by \fItagOrId\fR, delete the characters
  649. in the range given by \fIfirst\fR and \fIlast\fR,
  650. inclusive.
  651. If some of the items given by \fItagOrId\fR don't support
  652. text operations, then they are ignored.
  653. \fIFirst\fR and \fIlast\fR are indices of characters
  654. within the item(s) as described in INDICES above.
  655. If \fIlast\fR is omitted, it defaults to \fIfirst\fR.
  656. This command returns an empty string.
  657. .TP
  658. \fIpathName \fBdelete \fR?\fItagOrId tagOrId ...\fR?
  659. Delete each of the items given by each \fItagOrId\fR, and return
  660. .VS
  661. an empty string.
  662. .VE
  663. .TP
  664. \fIpathName \fBdtag \fItagOrId \fR?tagToDelete\fR?
  665. For each of the items given by \fItagOrId\fR, delete the
  666. tag given by \fItagToDelete\fR from the list of those
  667. associated with the item.
  668. If an item doesn't have the tag \fItagToDelete\fR then
  669. the item is unaffected by the command.
  670. If \fItagToDelete\fR is omitted then it defaults to \fItagOrId\fR.
  671. This command returns an empty string.
  672. .TP
  673. \fIpathName \fBfind \fIsearchCommand \fR?\fIarg arg ...\fR?
  674. This command returns a list consisting of all the items that
  675. meet the constraints specified by \fIsearchCommand\fR and
  676. \fIarg\fR's.
  677. \fISearchCommand\fR and \fIargs\fR have any of the forms
  678. accepted by the \fBaddtag\fR command.
  679. .TP
  680. \fIpathName \fBfocus \fR?\fItagOrId\fR?
  681. Set the keyboard focus for the canvas widget to the item given by
  682. \fItagOrId\fR.
  683. If \fItagOrId\fR refers to several items, then the focus is set
  684. to the first such item in the display list that supports the
  685. insertion cursor.
  686. If \fItagOrId\fR doesn't refer to any items, or if none of them
  687. support the insertion cursor, then the focus isn't changed.
  688. If \fItagOrId\fR is an empty
  689. string, then the focus item is reset so that no item has the focus.
  690. If \fItagOrId\fR is not specified then the command returns the
  691. id for the item that currently has the focus, or an empty string
  692. if no item has the focus.
  693. .RS
  694. .LP
  695. Once the focus has been set to an item, the item will display
  696. the insertion cursor and all keyboard events will be directed
  697. to that item.
  698. The focus item within a canvas and the focus window on the
  699. screen (set with the \fBfocus\fR command) are totally independent:
  700. a given item doesn't actually have the input focus unless (a)
  701. its canvas is the focus window and (b) the item is the focus item
  702. within the canvas.
  703. In most cases it is advisable to follow the \fBfocus\fR widget
  704. command with the \fBfocus\fR command to set the focus window to
  705. the canvas (if it wasn't there already).
  706. .RE
  707. .TP
  708. \fIpathName \fBgettags\fR \fItagOrId\fR
  709. Return a list whose elements are the tags associated with the
  710. item given by \fItagOrId\fR.
  711. If \fItagOrId\fR refers to more than one item, then the tags
  712. are returned from the first such item in the display list.
  713. If \fItagOrId\fR doesn't refer to any items, or if the item
  714. contains no tags, then an empty string is returned.
  715. .TP
  716. \fIpathName \fBicursor \fItagOrId index\fR
  717. .VS
  718. Set the position of the insertion cursor for the item(s)
  719. given by \fItagOrId\fR
  720. to just before the character whose position is given by \fIindex\fR.
  721. If some or all of the items given by \fItagOrId\fR don't support
  722. an insertion cursor then this command has no effect on them.
  723. See INDICES above for a description of the
  724. legal forms for \fIindex\fR.
  725. Note:  the insertion cursor is only displayed in an item if
  726. that item currently has the keyboard focus (see the widget
  727. command \fBfocus\fR, below), but the cursor position may
  728. be set even when the item doesn't have the focus.
  729. This command returns an empty string.
  730. .VE
  731. .TP
  732. \fIpathName \fBindex \fItagOrId index\fR
  733. This command returns a decimal string giving the numerical index
  734. within \fItagOrId\fR corresponding to \fIindex\fR.
  735. \fIIndex\fR gives a textual description of the desired position
  736. as described in INDICES above.
  737. The return value is guaranteed to lie between 0 and the number
  738. of characters within the item, inclusive.
  739. If \fItagOrId\fR refers to multiple items, then the index
  740. is processed in the first of these items that supports indexing
  741. operations (in display list order).
  742. .TP
  743. \fIpathName \fBinsert \fItagOrId beforeThis string\fR
  744. For each of the items given by \fItagOrId\fR, if the item supports
  745. text insertion then \fIstring\fR is inserted into the item's
  746. text just before the character whose index is \fIbeforeThis\fR.
  747. See INDICES above for information about the forms allowed
  748. for \fIbeforeThis\fR.
  749. This command returns an empty string.
  750. .TP
  751. \fIpathName \fBitemconfigure \fItagOrId\fR ?\fIoption\fR? ?\fIvalue\fR? ?\fIoption value ...\fR?
  752. This command is similar to the \fBconfigure\fR widget command except
  753. that it modifies item-specific options for the items given by
  754. \fItagOrId\fR instead of modifying options for the overall
  755. canvas widget.
  756. If no \fIoption\fR is specified, returns a list describing all of
  757. the available options for the first item given by \fItagOrId\fR
  758. (see \fBTk_ConfigureInfo\fR for
  759. information on the format of this list).  If \fIoption\fR is specified
  760. with no \fIvalue\fR, then the command returns a list describing the
  761. one named option (this list will be identical to the corresponding
  762. sublist of the value returned if no \fIoption\fR is specified).  If
  763. one or more \fIoption\-value\fR pairs are specified, then the command
  764. modifies the given widget option(s) to have the given value(s) in
  765. each of the items given by \fItagOrId\fR;  in
  766. this case the command returns an empty string.
  767. The \fIoption\fRs and \fIvalue\fRs are the same as those permissible
  768. in the \fBcreate\fR widget command when the item(s) were created;
  769. see the sections describing individual item types below for details
  770. on the legal options.
  771. .TP
  772. \fIpathName \fBlower \fItagOrId \fR?\fIbelowThis\fR?
  773. Move all of the items given by \fItagOrId\fR to a new position
  774. in the display list just before the item given by \fIbelowThis\fR.
  775. If \fItagOrId\fR refers to more than one item then all are moved
  776. but the relative order of the moved items will not be changed.
  777. \fIBelowThis\fR is a tag or id;  if it refers to more than one
  778. item then the first (lowest) of these items in the display list is used
  779. as the destination location for the moved items.
  780. This command returns an empty string.
  781. .TP
  782. \fIpathName \fBmove \fItagOrId xAmount yAmount\fR
  783. Move each of the items given by \fItagOrId\fR in the canvas coordinate
  784. space by adding \fIxAmount\fR to the x-coordinate of each point
  785. associated with the item and \fIyAmount\fR to the y-coordinate of
  786. each point associated with the item.
  787. This command returns an empty string.
  788. .TP
  789. \fIpathName \fBpostscript \fR?\fIoption value option value ...\fR?
  790. .VS
  791. Generate a Postscript representation for part or all of the canvas.
  792. If the \fB\-file\fR option is specified then the Postscript is written
  793. to a file and an empty string is returned;  otherwise the Postscript
  794. is returned as the result of the command.
  795. The Postscript is created in Encapsulated Postscript form using
  796. version 3.0 of the Document Structuring Conventions.
  797. The \fIoption\fR\-\fIvalue\fR argument pairs provide additional
  798. information to control the generation of Postscript.  The following
  799. options are supported:
  800. .RS
  801. .TP
  802. \fB\-colormap \fIvarName\fR
  803. \fIVarName\fR must be the name of a global array variable
  804. that specifies a color mapping to use in the Postscript.
  805. Each element of \fIvarName\fR must consist of Postscript
  806. code to set a particular color value (e.g. ``\fB1.0 1.0 0.0 setrgbcolor\fR'').
  807. When outputting color information in the Postscript, Tk checks
  808. to see if there is an element of \fIvarName\fR with the same
  809. name as the color.
  810. If so, Tk uses the value of the element as the Postscript command
  811. to set the color.
  812. If this option hasn't been specified, or if there isn't an entry
  813. in \fIvarName\fR for a given color, then Tk uses the red, green,
  814. and blue intensities from the X color.
  815. .TP
  816. \fB\-colormode \fImode\fR
  817. Specifies how to output color information.  \fIMode\fR must be either
  818. \fBcolor\fR (for full color output), \fBgray\fR (convert all colors
  819. to their gray-scale equivalents) or \fBmono\fR (convert all colors
  820. to black or white).
  821. .TP
  822. \fB\-file \fIfileName\fR
  823. Specifies the name of the file in which to write the Postscript.
  824. If this option isn't specified then the Postscript is returned as the
  825. result of the command instead of being written to a file.
  826. .TP
  827. \fB\-fontmap \fIvarName\fR
  828. \fIVarName\fR must be the name of a global array variable
  829. that specifies a font mapping to use in the Postscript.
  830. Each element of \fIvarName\fR must consist of a Tcl list with
  831. two elements, which are the name and point size of a Postscript font.
  832. When outputting Postscript commands for a particular font, Tk
  833. checks to see if \fIvarName\fR contains an element with the same
  834. name as the font.
  835. If there is such an element, then the font information contained in
  836. that element is used in the Postscript.
  837. Otherwise Tk attempts to guess what Postscript font to use.
  838. Tk's guesses generally only work for well-known fonts such as
  839. Times and Helvetica and Courier, and only if the X font name does not
  840. omit any dashes up through the point size.
  841. For example, \fB\-*\-Courier\-Bold\-R\-Normal\-\-*\-120\-*\fR will work but
  842. \fB*Courier\-Bold\-R\-Normal*120*\fR will not;  Tk needs the dashes to
  843. parse the font name).
  844. .TP
  845. \fB\-height \fIsize\fR
  846. Specifies the height of the area of the canvas to print.
  847. Defaults to the height of the canvas window.
  848. .TP
  849. \fB\-pageanchor \fIanchor\fR
  850. Specifies which point of the printed area should be appear over
  851. the positioning point on the page (which is given by the \fB\-pagex\fR
  852. and \fB\-pagey\fR options).
  853. For example, \fB\-pageanchor n\fR means that the top center of the
  854. printed area should be over the positioning point.
  855. Defaults to \fBcenter\fR.
  856. .TP
  857. \fB\-pageheight \fIsize\fR
  858. Specifies that the Postscript should be scaled in both x and y so
  859. that the printed area is \fIsize\fR high on the Postscript page.
  860. \fISize\fR consists of a floating-point number followed by
  861. \fBc\fR for centimeters, \fBi\fR for inches, \fBm\fR for millimeters,
  862. or \fBp\fR or nothing for printer's points (1/72 inch).
  863. Defaults to the height of the printed area on the screen.
  864. If both \fB\-pageheight\fR and \fB\-pagewidth\fR are specified then
  865. the scale factor from the later option is used (non-uniform scaling
  866. is not implemented).
  867. .TP
  868. \fB\-pagewidth \fIsize\fR
  869. Specifies that the Postscript should be scaled in both x and y so
  870. that the printed area is \fIsize\fR wide on the Postscript page.
  871. \fISize\fR has the same form as for \fB\-pageheight\fR.
  872. Defaults to the width of the printed area on the screen.
  873. If both \fB\-pageheight\fR and \fB\-pagewidth\fR are specified then
  874. the scale factor from the later option is used (non-uniform scaling
  875. is not implemented).
  876. .TP
  877. \fB\-pagex \fIposition\fR
  878. \fIPosition\fR gives the x-coordinate of the positioning point on
  879. the Postscript page, using any of the forms allowed for \fB\-pageheight\fR.
  880. Used in conjunction with the \fB\-pagey\fR and \fB\-pageanchor\fR options
  881. to determine where the printed area appears on the Postscript page.
  882. Defaults to the center of the page.
  883. .TP
  884. \fB\-pagey \fIposition\fR
  885. \fIPosition\fR gives the y-coordinate of the positioning point on
  886. the Postscript page, using any of the forms allowed for \fB\-pageheight\fR.
  887. Used in conjunction with the \fB\-pagex\fR and \fB\-pageanchor\fR options
  888. to determine where the printed area appears on the Postscript page.
  889. Defaults to the center of the page.
  890. .TP
  891. \fB\-rotate \fIboolean\fR
  892. \fIBoolean\fR specifies whether the printed area is to be rotated 90
  893. degrees.
  894. In non-rotated output the x-axis of the printed area runs along
  895. the short dimension of the page (``portrait'' orientation);
  896. in rotated output the x-axis runs along the long dimension of the
  897. page (``landscape'' orientation).
  898. Defaults to non-rotated.
  899. .TP
  900. \fB\-width \fIsize\fR
  901. Specifies the width of the area of the canvas to print.
  902. Defaults to the width of the canvas window.
  903. .TP
  904. \fB\-x \fIposition\fR
  905. Specifies the x-coordinate of the left edge of the area of the
  906. canvas that is to be printed, in canvas coordinates, not window
  907. coordinates.
  908. Defaults to the coordinate of the left edge of the window.
  909. .TP
  910. \fB\-y \fIposition\fR
  911. Specifies the y-coordinate of the top edge of the area of the
  912. canvas that is to be printed, in canvas coordinates, not window
  913. coordinates.
  914. Defaults to the coordinate of the top edge of the window.
  915. .RE
  916. .VE
  917. .TP
  918. \fIpathName \fBraise \fItagOrId \fR?\fIaboveThis\fR?
  919. Move all of the items given by \fItagOrId\fR to a new position
  920. in the display list just after the item given by \fIaboveThis\fR.
  921. If \fItagOrId\fR refers to more than one item then all are moved
  922. but the relative order of the moved items will not be changed.
  923. \fIAboveThis\fR is a tag or id;  if it refers to more than one
  924. item then the last (topmost) of these items in the display list is used
  925. as the destination location for the moved items.
  926. This command returns an empty string.
  927. .TP
  928. \fIpathName \fBscale \fItagOrId xOrigin yOrigin xScale yScale\fR
  929. Rescale all of the items given by \fItagOrId\fR in canvas coordinate
  930. space.
  931. \fIXOrigin\fR and \fIyOrigin\fR identify the origin for the scaling
  932. operation and \fIxScale\fR and \fIyScale\fR identify the scale
  933. factors for x- and y-coordinates, respectively (a scale factor of
  934. 1.0 implies no change to that coordinate).
  935. For each of the points defining each item, the x-coordinate is
  936. adjusted to change the distance from \fIxOrigin\fR by a factor
  937. of \fIxScale\fR.
  938. Similarly, each y-coordinate is adjusted to change the distance
  939. from \fIyOrigin\fR by a factor of \fIyScale\fR.
  940. This command returns an empty string.
  941. .TP
  942. \fIpathName \fBscan\fR \fIoption args\fR
  943. This command is used to implement scanning on canvases.  It has
  944. two forms, depending on \fIoption\fR:
  945. .RS
  946. .TP
  947. \fIpathName \fBscan mark \fIx y\fR
  948. Records \fIx\fR and \fIy\fR and the canvas's current view;  used
  949. in conjunction with later \fBscan dragto\fR commands.
  950. Typically this command is associated with a mouse button press in
  951. the widget and \fIx\fR and \fIy\fR are the coordinates of the
  952. mouse.  It returns an empty string.
  953. .TP
  954. \fIpathName \fBscan dragto \fIx y\fR.
  955. This command computes the difference between its \fIx\fR and \fIy\fR
  956. arguments (which are typically mouse coordinates) and the \fIx\fR and
  957. \fIy\fR arguments to the last \fBscan mark\fR command for the widget.
  958. It then adjusts the view by 10 times the
  959. difference in coordinates.  This command is typically associated
  960. with mouse motion events in the widget, to produce the effect of
  961. dragging the canvas at high speed through its window.  The return
  962. value is an empty string.
  963. .RE
  964. .TP
  965. \fIpathName \fBselect \fIoption\fR ?\fItagOrId arg\fR?
  966. Manipulates the selection in one of several ways, depending on
  967. \fIoption\fR.
  968. The command may take any of the forms described below.
  969. In all of the descriptions below, \fItagOrId\fR must refer to
  970. an item that supports indexing and selection;  if it refers to
  971. multiple items then the first of
  972. these that supports indexing and the selection is used.
  973. \fIIndex\fR gives a textual description of a position
  974. within \fItagOrId\fR, as described in INDICES above.
  975. .RS
  976. .TP
  977. \fIpathName \fBselect adjust \fItagOrId index\fR
  978. Locate the end of the selection in \fItagOrId\fR nearest
  979. to the character given by \fIindex\fR, and adjust that
  980. end of the selection to be at \fIindex\fR (i.e. including
  981. but not going beyond \fIindex\fR).
  982. The other end of the selection is made the anchor point
  983. for future \fBselect to\fR commands.
  984. If the selection isn't currently in \fItagOrId\fR then
  985. this command behaves the same as the \fBselect to\fR widget
  986. command.
  987. Returns an empty string.
  988. .TP
  989. \fIpathName \fBselect clear\fR
  990. Clear the selection if it is in this widget.
  991. If the selection isn't in this widget then the command
  992. has no effect.
  993. Returns an empty string.
  994. .TP
  995. \fIpathName \fBselect from \fItagOrId index\fR
  996. Set the selection anchor point for the widget to be just
  997. before the character
  998. given by \fIindex\fR in the item given by \fItagOrId\fR.
  999. This command doesn't change the selection;  it just sets
  1000. the fixed end of the selection for future \fBselect to\fR
  1001. commands.
  1002. Returns an empty string.
  1003. .TP
  1004. \fIpathName \fBselect item\fR
  1005. Returns the id of the selected item, if the selection is in an
  1006. item in this canvas.
  1007. If the selection is not in this canvas then an empty string
  1008. is returned.
  1009. .TP
  1010. \fIpathName \fBselect to \fItagOrId index\fR
  1011. Set the selection to consist of those characters of \fItagOrId\fR
  1012. between the selection anchor point and
  1013. \fIindex\fR.
  1014. The new selection will include the character given by \fIindex\fR;
  1015. it will include the character given by the anchor point only if
  1016. \fIindex\fR is greater than or equal to the anchor point.
  1017. The anchor point is determined by the most recent \fBselect adjust\fR
  1018. or \fBselect from\fR command for this widget.
  1019. If the selection anchor point for the widget isn't currently in
  1020. \fItagOrId\fR, then it is set to the same character given
  1021. by \fIindex\fR.
  1022. Returns an empty string.
  1023. .RE
  1024. .TP
  1025. \fIpathName \fBtype\fI tagOrId\fR
  1026. Returns the type of the item given by \fItagOrId\fR, such as
  1027. \fBrectangle\fR or \fBtext\fR.
  1028. If \fItagOrId\fR refers to more than one item, then the type
  1029. of the first item in the display list is returned.
  1030. If \fItagOrId\fR doesn't refer to any items at all then
  1031. an empty string is returned.
  1032. .TP
  1033. \fIpathName \fBxview\fI index\fR
  1034. Change the view in the canvas so that the canvas position given by
  1035. \fIindex\fR appears at the left edge of the window.
  1036. This command is typically used by scrollbars to scroll the
  1037. canvas.
  1038. \fIIndex\fR counts in units of scroll increments (the value of the
  1039. \fBscrollIncrement\fR option):  a value of 0 corresponds to the left
  1040. edge of the scroll region (as defined by the \fBscrollRegion\fR
  1041. option),  a value of 1 means one scroll unit to the right of this,
  1042. and so on.  The return value is an empty string.
  1043. .TP
  1044. \fIpathName \fByview\fI index\fR
  1045. Change the view in the canvas so that the canvas position given by
  1046. \fIindex\fR appears at the top edge of the window.
  1047. This command is typically used by scrollbars to scroll the
  1048. canvas.
  1049. \fIIndex\fR counts in units of scroll increments (the value of the
  1050. \fBscrollIncrement\fR option):  a value of 0 corresponds to the top
  1051. edge of the scroll region (as defined by the \fBscrollRegion\fR
  1052. option),  a value of 1 means one scroll unit below this,
  1053. and so on.  The return value is an empty string.
  1054.  
  1055. .SH "OVERVIEW OF ITEM TYPES"
  1056. .PP
  1057. The sections below describe the various types of items supported
  1058. by canvas widgets.  Each item type is characterized by two things:
  1059. first, the form of the \fBcreate\fR command used to create
  1060. instances of the type;  and second, a set of configuration options
  1061. for items of that type, which may be used in the
  1062. \fBcreate\fR and \fBitemconfigure\fR widget commands.
  1063. Most items don't support indexing or selection or the commands
  1064. related to them, such as \fBindex\fR and \fBinsert\fR.
  1065. Where items do support these facilities, it is noted explicitly
  1066. in the descriptions below (at present, only text items provide
  1067. this support).
  1068.  
  1069. .SH "ARC ITEMS"
  1070. .PP
  1071. .VS
  1072. Items of type \fBarc\fR appear on the display as arc-shaped regions.
  1073. An arc is a section of an oval delimited by two angles (specified
  1074. by the \fB\-start\fR and \fB\-extent\fR options) and displayed in
  1075. one of several ways (specified by the \fB\-style\fR option).
  1076. Arcs are created with widget commands of the following form:
  1077. .DS
  1078. \fIpathName \fBcreate arc \fIx1 y1 x2 y2 \fR?\fIoption value option value ...\fR?
  1079. .DE
  1080. The arguments \fIx1\fR, \fIy1\fR, \fIx2\fR, and \fIy2\fR give
  1081. the coordinates of two diagonally opposite corners of a
  1082. rectangular region enclosing the oval that defines the arc.
  1083. After the coordinates there may be any number of \fIoption\fR-\fIvalue\fR
  1084. pairs, each of which sets one of the configuration options
  1085. for the item.  These same \fIoption\fR\-\fIvalue\fR pairs may be
  1086. used in \fBitemconfigure\fR widget commands to change the item's
  1087. configuration.
  1088. The following options are supported for arcs:
  1089. .TP
  1090. \fB\-extent \fIdegrees\fR
  1091. Specifies the size of the angular range occupied by the arc.
  1092. The arc's range extends for \fIdegrees\fR degrees counter-clockwise
  1093. from the starting angle given by the \fB\-start\fR option.
  1094. \fIDegrees\fR may be negative.
  1095. .TP
  1096. \fB\-fill \fIcolor\fR
  1097. Fill the region of the arc with \fIcolor\fR.
  1098. \fIColor\fR may have any of the forms accepted by \fBTk_GetColor\fR.
  1099. If \fIcolor\fR is an empty string (the default), then
  1100. then the arc will not be filled.
  1101. .TP
  1102. \fB\-outline \fIcolor\fR
  1103. \fIColor\fR specifies a color to use for drawing the arc's
  1104. outline;  it may have any of the forms accepted by \fBTk_GetColor\fR.
  1105. This option defaults to \fBblack\fR.  If the arc's style is
  1106. \fBarc\fR then this option is ignored (the section of perimeter is
  1107. filled using the \fB\-fill\fR option).  If \fIcolor\fR is specified
  1108. as an empty string then no outline is drawn for the arc.
  1109. .TP
  1110. \fB\-start \fIdegrees\fR
  1111. Specifies the beginning of the angular range occupied by the
  1112. arc.
  1113. \fIDegrees\fR is given in units of degrees measured counter-clockwise
  1114. from the 3-o'clock position;  it may be either positive or negative.
  1115. .TP
  1116. \fB\-stipple \fIbitmap\fR
  1117. Indicates that the arc should be filled in a stipple pattern;
  1118. \fIbitmap\fR specifies the stipple pattern to use, in any of the
  1119. forms accepted by \fBTk_GetBitmap\fR.
  1120. If the \fB\-fill\fR option hasn't been specified then this option
  1121. has no effect.
  1122. If \fIbitmap\fR is an empty string (the default), then filling is done
  1123. in a solid fashion.
  1124. .TP
  1125. \fB\-style \fItype\fR
  1126. Specifies how to draw the arc.  If \fItype\fR is \fBpieslice\fR
  1127. (the default) then the arc's region is defined by a section
  1128. of the oval's perimeter plus two line segments, one between the center
  1129. of the oval and each end of the perimeter section.
  1130. If \fItype\fR is \fBchord\fR then the arc's region is defined
  1131. by a section of the oval's perimeter plus a single line segment
  1132. connecting the two end points of the perimeter section.
  1133. If \fItype\fR is \fBarc\fR then the arc's region consists of
  1134. a section of the perimeter alone.  In this last case there is
  1135. no outline for the arc and the \fB\-outline\fR option is ignored.
  1136. .TP
  1137. \fB\-tags \fItagList\fR
  1138. Specifies a set of tags to apply to the item.
  1139. \fITagList\fR consists of a list of tag names, which replace any
  1140. existing tags for the item.
  1141. \fITagList\fR may be an empty list.
  1142. .TP
  1143. \fB\-width \fIoutlineWidth\fR
  1144. Specifies the width of the outline to be drawn around
  1145. the arc's region, in any of the forms described in the COORDINATES
  1146. section above.
  1147. If the \fB\-outline\fR option has been specified as an empty string
  1148. then this option has no effect.
  1149. Wide outlines will be drawn centered on the edges of the arc's region.
  1150. This option defaults to 1.0.
  1151.  
  1152. .SH "BITMAP ITEMS"
  1153. .PP
  1154. Items of type \fBbitmap\fR appear on the display as images with
  1155. two colors, foreground and background.
  1156. Bitmaps are created with widget commands of the following form:
  1157. .DS
  1158. \fIpathName \fBcreate bitmap \fIx y \fR?\fIoption value option value ...\fR?
  1159. .DE
  1160. The arguments \fIx\fR and \fIy\fR specify the coordinates of a
  1161. point used to position the bitmap on the display (see the \fB\-anchor\fR
  1162. option below for more information on how bitmaps are displayed).
  1163. After the coordinates there may be any number of \fIoption\fR-\fIvalue\fR
  1164. pairs, each of which sets one of the configuration options
  1165. for the item.  These same \fIoption\fR\-\fIvalue\fR pairs may be
  1166. used in \fBitemconfigure\fR widget commands to change the item's
  1167. configuration.
  1168. The following options are supported for bitmaps:
  1169. .TP
  1170. \fB\-anchor \fIanchorPos\fR
  1171. \fIAnchorPos\fR tells how to position the bitmap relative to the
  1172. positioning point for the item;  it may have any of the forms
  1173. accepted by \fBTk_GetAnchor\fR.  For example, if \fIanchorPos\fR
  1174. is \fBcenter\fR then the bitmap is centered on the point;  if
  1175. \fIanchorPos\fR is \fBn\fR then the bitmap will be drawn so that
  1176. its top center point is at the positioning point.
  1177. This option defaults to \fBcenter\fR.
  1178. .TP
  1179. \fB\-background \fIcolor\fR
  1180. Specifies a color to use for each of the bitmap pixels
  1181. whose value is 0.
  1182. \fIColor\fR may have any of the forms accepted by \fBTk_GetColor\fR.
  1183. If this option isn't specified, or if it is specified as an empty
  1184. string, then the background color for the canvas is used.
  1185. .TP
  1186. \fB\-bitmap \fIbitmap\fR
  1187. Specifies the bitmap to display in the item.
  1188. \fIBitmap\fR may have any of the forms accepted by \fBTk_GetBitmap\fR.
  1189. .TP
  1190. \fB\-foreground \fIcolor\fR
  1191. Specifies a color to use for each of the bitmap pixels
  1192. whose value is 1.
  1193. \fIColor\fR may have any of the forms accepted by \fBTk_GetColor\fR and
  1194. defaults to \fBblack\fR.
  1195. .TP
  1196. \fB\-tags \fItagList\fR
  1197. Specifies a set of tags to apply to the item.
  1198. \fITagList\fR consists of a list of tag names, which replace any
  1199. existing tags for the item.
  1200. \fITagList\fR may be an empty list.
  1201. .VE
  1202.  
  1203. .SH "LINE ITEMS"
  1204. .PP
  1205. Items of type \fBline\fR appear on the display as one or more connected
  1206. line segments or curves.
  1207. Lines are created with widget commands of the following form:
  1208. .DS
  1209. \fIpathName \fBcreate line \fIx1 y1... xn yn \fR?\fIoption value option value ...\fR?
  1210. .DE
  1211. The arguments \fIx1\fR through \fIyn\fR give
  1212. the coordinates for a series of two or more points that describe
  1213. a series of connected line segments.
  1214. After the coordinates there may be any number of \fIoption\fR-\fIvalue\fR
  1215. pairs, each of which sets one of the configuration options
  1216. for the item.  These same \fIoption\fR\-\fIvalue\fR pairs may be
  1217. used in \fBitemconfigure\fR widget commands to change the item's
  1218. configuration.
  1219. The following options are supported for lines:
  1220. .TP
  1221. \fB\-arrow \fIwhere\fR
  1222. Indicates whether or not arrowheads are to be drawn at one or both
  1223. ends of the line.
  1224. \fIWhere\fR must have one of the values \fBnone\fR (for no arrowheads),
  1225. \fBfirst\fR (for an arrowhead at the first point of the line),
  1226. \fBlast\fR (for an arrowhead at the last point of the line), or
  1227. \fBboth\fR (for arrowheads at both ends).
  1228. This option defaults to \fBnone\fR.
  1229. .TP
  1230. \fB\-arrowshape \fIshape\fR
  1231. This option indicates how to draw arrowheads.
  1232. The \fIshape\fR argument must be a list with three elements, each
  1233. specifying a distance in any of the forms described in
  1234. the COORDINATES section above.
  1235. The first element of the list gives the distance along the line
  1236. from the neck of the arrowhead to its tip.
  1237. The second element gives the distance along the line from the
  1238. trailing points of the arrowhead to the tip, and the third
  1239. element gives the distance from the outside edge of the line to the
  1240. trailing points.
  1241. If this option isn't specified then Tk picks a ``reasonable'' shape.
  1242. .TP
  1243. \fB\-capstyle \fIstyle\fR
  1244. Specifies the ways in which caps are to be drawn at the endpoints
  1245. of the line.
  1246. \fIStyle\fR may have any of the forms accepted by \fBTk_GetCapStyle\fR
  1247. (\fBbutt\fR, \fBprojecting\fR, or \fBround\fR).
  1248. If this option isn't specified then it defaults to \fBbutt\fR.
  1249. Where arrowheads are drawn the cap style is ignored.
  1250. .TP
  1251. \fB\-fill \fIcolor\fR
  1252. \fIColor\fR specifies a color to use for drawing the line; it may have
  1253. any of the forms acceptable to \fBTk_GetColor\fR.  It may also be an
  1254. empty string, in which case the line will be transparent.
  1255. This option defaults to \fBblack\fR.
  1256. .TP
  1257. \fB\-joinstyle \fIstyle\fR
  1258. Specifies the ways in which joints are to be drawn at the vertices
  1259. of the line.
  1260. \fIStyle\fR may have any of the forms accepted by \fBTk_GetCapStyle\fR
  1261. (\fBbevel\fR, \fBmiter\fR, or \fBround\fR).
  1262. If this option isn't specified then it defaults to \fBmiter\fR.
  1263. If the line only contains two points then this option is
  1264. irrelevant.
  1265. .TP
  1266. \fB\-smooth \fIboolean\fR
  1267. .VS
  1268. \fIBoolean\fR must have one of the forms accepted by \fBTk_GetBoolean\fR.
  1269. It indicates whether or not the line should be drawn as a curve.
  1270. If so, the line is rendered as a set of Bezier splines: one spline
  1271. is drawn for the first and second line segments, one for the second
  1272. and third, and so on.  Straight-line segments can be generated within
  1273. a curve by duplicating the end-points of the desired line segment.
  1274. .TP
  1275. \fB\-splinesteps \fInumber\fR
  1276. Specifies the degree of smoothness desired for curves:  each spline
  1277. will be approximated with \fInumber\fR line segments.  This
  1278. option is ignored unless the \fB\-smooth\fR option is true.
  1279. .VE
  1280. .TP
  1281. \fB\-stipple \fIbitmap\fR
  1282. Indicates that the line should be filled in a stipple pattern;
  1283. \fIbitmap\fR specifies the stipple pattern to use, in any of the
  1284. forms accepted by \fBTk_GetBitmap\fR.
  1285. If \fIbitmap\fR is an empty string (the default), then filling is
  1286. done in a solid fashion.
  1287. .TP
  1288. \fB\-tags \fItagList\fR
  1289. .VS
  1290. Specifies a set of tags to apply to the item.
  1291. \fITagList\fR consists of a list of tag names, which replace any
  1292. existing tags for the item.
  1293. \fITagList\fR may be an empty list.
  1294. .VE
  1295. .TP
  1296. \fB\-width \fIlineWidth\fR
  1297. \fILineWidth\fR specifies the width of the line, in any of the forms
  1298. described in the COORDINATES section above.
  1299. Wide lines will be drawn centered on the path specified by the
  1300. points.
  1301. If this option isn't specified then it defaults to 1.0.
  1302.  
  1303. .SH "OVAL ITEMS"
  1304. .PP
  1305. Items of type \fBoval\fR appear as circular or oval regions on
  1306. the display.  Each oval may have an outline, a fill, or
  1307. both.  Ovals are created with widget commands of the
  1308. following form:
  1309. .DS
  1310. \fIpathName \fBcreate oval \fIx1 y1 x2 y2 \fR?\fIoption value option value ...\fR?
  1311. .DE
  1312. The arguments \fIx1\fR, \fIy1\fR, \fIx2\fR, and \fIy2\fR give
  1313. the coordinates of two diagonally opposite corners of a
  1314. rectangular region enclosing the oval.
  1315. The oval will include the top and left edges of the rectangle
  1316. not the lower or right edges.
  1317. If the region is square then the resulting oval is circular;
  1318. otherwise it is elongated in shape.
  1319. After the coordinates there may be any number of \fIoption\fR-\fIvalue\fR
  1320. pairs, each of which sets one of the configuration options
  1321. for the item.  These same \fIoption\fR\-\fIvalue\fR pairs may be
  1322. used in \fBitemconfigure\fR widget commands to change the item's
  1323. configuration.
  1324. The following options are supported for ovals:
  1325. .TP
  1326. \fB\-fill \fIcolor\fR
  1327. Fill the area of the oval with \fIcolor\fR.
  1328. \fIColor\fR may have any of the forms accepted by \fBTk_GetColor\fR.
  1329. If \fIcolor\fR is an empty string (the default), then
  1330. then the oval will not be filled.
  1331. .TP
  1332. \fB\-outline \fIcolor\fR
  1333. \fIColor\fR specifies a color to use for drawing the oval's
  1334. outline;  it may have any of the forms accepted by \fBTk_GetColor\fR.
  1335. This option defaults to \fBblack\fR.
  1336. If \fIcolor\fR is an empty string then no outline will be
  1337. drawn for the oval.
  1338. .TP
  1339. \fB\-stipple \fIbitmap\fR
  1340. Indicates that the oval should be filled in a stipple pattern;
  1341. \fIbitmap\fR specifies the stipple pattern to use, in any of the
  1342. forms accepted by \fBTk_GetBitmap\fR.
  1343. If the \fB\-fill\fR option hasn't been specified then this option
  1344. has no effect.
  1345. If \fIbitmap\fR is an empty string (the default), then filling is done
  1346. in a solid fashion.
  1347. .TP
  1348. \fB\-tags \fItagList\fR
  1349. .VS
  1350. Specifies a set of tags to apply to the item.
  1351. \fITagList\fR consists of a list of tag names, which replace any
  1352. existing tags for the item.
  1353. \fITagList\fR may be an empty list.
  1354. .VE
  1355. .TP
  1356. \fB\-width \fIoutlineWidth\fR
  1357. \fIoutlineWidth\fR specifies the width of the outline to be drawn around
  1358. the oval, in any of the forms described in the COORDINATES section above.
  1359. If the \fB\-outline\fR option hasn't been specified then this option
  1360. has no effect.
  1361. .VS
  1362. Wide outlines are drawn centered on the oval path defined by
  1363. \fIx1\fR, \fIy1\fR, \fIx2\fR, and \fIy2\fR.
  1364. .VE
  1365. This option defaults to 1.0.
  1366.  
  1367. .SH "POLYGON ITEMS"
  1368. .PP
  1369. Items of type \fBpolygon\fR appear as polygonal or curved filled regions
  1370. on the display.
  1371. Polygons are created with widget commands of the following form:
  1372. .DS
  1373. \fIpathName \fBcreate polygon \fIx1 y1 ... xn yn \fR?\fIoption value option value ...\fR?
  1374. .DE
  1375. The arguments \fIx1\fR through \fIyn\fR specify the coordinates for
  1376. three or more points that define a closed polygon.
  1377. The first and last points may be the same;  whether they are or not,
  1378. Tk will draw the polygon as a closed polygon.
  1379. After the coordinates there may be any number of \fIoption\fR-\fIvalue\fR
  1380. pairs, each of which sets one of the configuration options
  1381. for the item.  These same \fIoption\fR\-\fIvalue\fR pairs may be
  1382. used in \fBitemconfigure\fR widget commands to change the item's
  1383. configuration.
  1384. The following options are supported for polygons:
  1385. .TP
  1386. \fB\-fill \fIcolor\fR
  1387. \fIColor\fR specifies a color to use for filling the area of the
  1388. polygon; it may have any of the forms acceptable to \fBTk_GetColor\fR.
  1389. If \fIcolor\fR is an empty string then the polygon will be
  1390. transparent.
  1391. This option defaults to \fBblack\fR.
  1392. .TP
  1393. \fB\-smooth \fIboolean\fR
  1394. .VS
  1395. \fIBoolean\fR must have one of the forms accepted by \fBTk_GetBoolean\fR
  1396. It indicates whether or not the polygon should be drawn with a
  1397. curved perimeter.
  1398. If so, the outline of the polygon becomes a set of Bezier splines,
  1399. one spline for the first and second line segments, one for the second
  1400. and third, and so on.  Straight-line segments can be generated in a
  1401. smoothed polygon by duplicating the end-points of the desired line segment.
  1402. .TP
  1403. \fB\-splinesteps \fInumber\fR
  1404. Specifies the degree of smoothness desired for curves:  each spline
  1405. will be approximated with \fInumber\fR line segments.  This
  1406. option is ignored unless the \fB\-smooth\fR option is true.
  1407. .VE
  1408. .TP
  1409. \fB\-stipple \fIbitmap\fR
  1410. Indicates that the polygon should be filled in a stipple pattern;
  1411. \fIbitmap\fR specifies the stipple pattern to use, in any of the
  1412. forms accepted by \fBTk_GetBitmap\fR.
  1413. If \fIbitmap\fR is an empty string (the default), then filling is
  1414. done in a solid fashion.
  1415. .TP
  1416. \fB\-tags \fItagList\fR
  1417. .VS
  1418. Specifies a set of tags to apply to the item.
  1419. \fITagList\fR consists of a list of tag names, which replace any
  1420. existing tags for the item.
  1421. \fITagList\fR may be an empty list.
  1422. .VE
  1423.  
  1424. .SH "RECTANGLE ITEMS"
  1425. .PP
  1426. Items of type \fBrectangle\fR appear as rectangular regions on
  1427. the display.  Each rectangle may have an outline, a fill, or
  1428. both.  Rectangles are created with widget commands of the
  1429. following form:
  1430. .DS
  1431. \fIpathName \fBcreate rectangle \fIx1 y1 x2 y2 \fR?\fIoption value option value ...\fR?
  1432. .DE
  1433. The arguments \fIx1\fR, \fIy1\fR, \fIx2\fR, and \fIy2\fR give
  1434. the coordinates of two diagonally opposite corners of the rectangle
  1435. (the rectangle will include its upper and left edges but not
  1436. its lower or right edges).
  1437. After the coordinates there may be any number of \fIoption\fR-\fIvalue\fR
  1438. pairs, each of which sets one of the configuration options
  1439. for the item.  These same \fIoption\fR\-\fIvalue\fR pairs may be
  1440. used in \fBitemconfigure\fR widget commands to change the item's
  1441. configuration.
  1442. The following options are supported for rectangles:
  1443. .TP
  1444. \fB\-fill \fIcolor\fR
  1445. Fill the area of the rectangle with \fIcolor\fR, which may be
  1446. specified in any of the forms accepted by \fBTk_GetColor\fR.
  1447. If \fIcolor\fR is an empty string (the default), then
  1448. then the rectangle will not be filled.
  1449. .TP
  1450. \fB\-outline \fIcolor\fR
  1451. Draw an outline around the edge of the rectangle in \fIcolor\fR.
  1452. \fIColor\fR may have any of the forms accepted by \fBTk_GetColor\fR.
  1453. This option defaults to \fBblack\fR.
  1454. If \fIcolor\fR is an empty string then no outline will be
  1455. drawn for the rectangle.
  1456. .TP
  1457. \fB\-stipple \fIbitmap\fR
  1458. Indicates that the rectangle should be filled in a stipple pattern;
  1459. \fIbitmap\fR specifies the stipple pattern to use, in any of the
  1460. forms accepted by \fBTk_GetBitmap\fR.
  1461. If the \fB\-fill\fR option hasn't been specified then this option
  1462. has no effect.
  1463. If \fIbitmap\fR is an empty string (the default), then filling
  1464. is done in a solid fashion.
  1465. .TP
  1466. \fB\-tags \fItagList\fR
  1467. .VS
  1468. Specifies a set of tags to apply to the item.
  1469. \fITagList\fR consists of a list of tag names, which replace any
  1470. existing tags for the item.
  1471. \fITagList\fR may be an empty list.
  1472. .VE
  1473. .TP
  1474. \fB\-width \fIoutlineWidth\fR
  1475. \fIOutlineWidth\fR specifies the width of the outline to be drawn around
  1476. the rectangle, in any of the forms described in the COORDINATES section above.
  1477. If the \fB\-outline\fR option hasn't been specified then this option
  1478. has no effect.
  1479. .VS
  1480. Wide outlines are drawn centered on the rectangular path
  1481. defined by \fIx1\fR, \fIy1\fR, \fIx2\fR, and \fIy2\fR.
  1482. .VE
  1483. This option defaults to 1.0.
  1484.  
  1485. .SH "TEXT ITEMS"
  1486. .PP
  1487. A text item displays a string of characters on the screen in one
  1488. or more lines.
  1489. Text items support indexing and selection, along with the
  1490. following text-related canvas widget commands:  \fBdchars\fR,
  1491. \fBfocus\fR, \fBicursor\fR, \fBindex\fR, \fBinsert\fR,
  1492. .VS
  1493. .VE
  1494. \fBselect\fR.
  1495. Text items are created with widget commands of the following
  1496. form:
  1497. .DS
  1498. \fIpathName \fBcreate text \fIx y \fR?\fIoption value option value ...\fR?
  1499. .DE
  1500. The arguments \fIx\fR and \fIy\fR specify the coordinates of a
  1501. point used to position the text on the display (see the options
  1502. below for more information on how text is displayed).
  1503. After the coordinates there may be any number of \fIoption\fR-\fIvalue\fR
  1504. pairs, each of which sets one of the configuration options
  1505. for the item.  These same \fIoption\fR\-\fIvalue\fR pairs may be
  1506. used in \fBitemconfigure\fR widget commands to change the item's
  1507. configuration.
  1508. The following options are supported for text items:
  1509. .TP
  1510. \fB\-anchor \fIanchorPos\fR
  1511. \fIAnchorPos\fR tells how to position the text relative to the
  1512. positioning point for the text;  it may have any of the forms
  1513. accepted by \fBTk_GetAnchor\fR.  For example, if \fIanchorPos\fR
  1514. is \fBcenter\fR then the text is centered on the point;  if
  1515. \fIanchorPos\fR is \fBn\fR then the text will be drawn such that
  1516. the top center point of the rectangular region occupied by the
  1517. text will be at the positioning point.
  1518. This option defaults to \fBcenter\fR.
  1519. .TP
  1520. \fB\-fill \fIcolor\fR
  1521. \fIColor\fR specifies a color to use for filling the text characters;
  1522. it may have any of the forms accepted by \fBTk_GetColor\fR.
  1523. If this option isn't specified then it defaults to \fBblack\fR.
  1524. .TP
  1525. \fB\-font \fIfontName\fR
  1526. Specifies the font to use for the text item.
  1527. \fIFontName\fR may be any string acceptable to \fBTk_GetFontStruct\fR.
  1528. If this option isn't specified, it defaults to a system-dependent
  1529. font.
  1530. .TP
  1531. \fB\-justify \fIhow\fR
  1532. Specifies how to justify the text within its bounding region.
  1533. \fIHow\fR must be one of the values \fBleft\fR, \fBright\fR,
  1534. or \fBcenter\fR.
  1535. This option will only matter if the text is displayed as multiple
  1536. lines.
  1537. If the option is omitted, it defaults to \fBleft\fR.
  1538. .TP
  1539. \fB\-stipple \fIbitmap\fR
  1540. Indicates that the text should be drawn in a stippled pattern
  1541. rather than solid;
  1542. \fIbitmap\fR specifies the stipple pattern to use, in any of the
  1543. forms accepted by \fBTk_GetBitmap\fR.
  1544. If \fIbitmap\fR is an empty string (the default) then the text
  1545. is drawn in a solid fashion.
  1546. .TP
  1547. \fB\-tags \fItagList\fR
  1548. .VS
  1549. Specifies a set of tags to apply to the item.
  1550. \fITagList\fR consists of a list of tag names, which replace any
  1551. existing tags for the item.
  1552. \fITagList\fR may be an empty list.
  1553. .VE
  1554. .TP
  1555. \fB\-text \fIstring\fR
  1556. \fIString\fR specifies the characters to be displayed in the text item.
  1557. Newline characters cause line breaks.
  1558. The characters in the item may also be changed with the
  1559. \fBinsert\fR and \fBdelete\fR widget commands.
  1560. This option defaults to an empty string.
  1561. .TP
  1562. \fB\-width \fIlineLength\fR
  1563. Specifies a maximum line length for the text, in any of the forms
  1564. described in the COORDINATES section abov.
  1565. If this option is zero (the default) the text is broken into
  1566. lines only at newline characters.
  1567. However, if this option is non-zero then any line that would
  1568. be longer than \fIlineLength\fR is broken just before a space
  1569. character to make the line shorter than \fIlineLength\fR;  the
  1570. space character is treated as if it were a newline
  1571. character.
  1572.  
  1573. .SH "WINDOW ITEMS"
  1574. .PP
  1575. .VS
  1576. Items of type \fBwindow\fR cause a particular window to be displayed
  1577. at a given position on the canvas.
  1578. Window items are created with widget commands of the following form:
  1579. .DS
  1580. \fIpathName \fBcreate window \fIx y \fR?\fIoption value option value ...\fR?
  1581. .DE
  1582. The arguments \fIx\fR and \fIy\fR specify the coordinates of a
  1583. point used to position the window on the display (see the \fB\-anchor\fR
  1584. option below for more information on how bitmaps are displayed).
  1585. After the coordinates there may be any number of \fIoption\fR-\fIvalue\fR
  1586. pairs, each of which sets one of the configuration options
  1587. for the item.  These same \fIoption\fR\-\fIvalue\fR pairs may be
  1588. used in \fBitemconfigure\fR widget commands to change the item's
  1589. configuration.
  1590. The following options are supported for window items:
  1591. .TP
  1592. \fB\-anchor \fIanchorPos\fR
  1593. \fIAnchorPos\fR tells how to position the window relative to the
  1594. positioning point for the item;  it may have any of the forms
  1595. accepted by \fBTk_GetAnchor\fR.  For example, if \fIanchorPos\fR
  1596. is \fBcenter\fR then the window is centered on the point;  if
  1597. \fIanchorPos\fR is \fBn\fR then the window will be drawn so that
  1598. its top center point is at the positioning point.
  1599. This option defaults to \fBcenter\fR.
  1600. .TP
  1601. \fB\-height \fIpixels\fR
  1602. Specifies the height to assign to the item's window.
  1603. \fIPixels\fR may have any of the
  1604. forms described in the COORDINATES section above.
  1605. If this option isn't specified, or if it is specified as an empty
  1606. string, then the window is given whatever height it requests internally.
  1607. .TP
  1608. \fB\-tags \fItagList\fR
  1609. Specifies a set of tags to apply to the item.
  1610. \fITagList\fR consists of a list of tag names, which replace any
  1611. existing tags for the item.
  1612. \fITagList\fR may be an empty list.
  1613. .TP
  1614. \fB\-width \fIpixels\fR
  1615. Specifies the width to assign to the item's window.
  1616. \fIPixels\fR may have any of the
  1617. forms described in the COORDINATES section above.
  1618. If this option isn't specified, or if it is specified as an empty
  1619. string, then the window is given whatever width it requests internally.
  1620. .TP
  1621. \fB\-window \fIpathName\fR
  1622. Specifies the window to associate with this item.
  1623. The window specified by \fIpathName\fR must either be a child of
  1624. the canvas widget or a child of some ancestor of the canvas widget.
  1625. \fIPathName\fR may not refer to a top-level window.
  1626. .VE
  1627.  
  1628. .SH "APPLICATION-DEFINED ITEM TYPES"
  1629. .PP
  1630. It is possible for individual applications to define new item
  1631. types for canvas widgets using C code.
  1632. The interfaces for this mechanism are not presently documented,
  1633. and it's possible they may change, but you should be able to
  1634. see how they work by examining the code for some of the existing
  1635. item types.
  1636.  
  1637. .SH BINDINGS
  1638. .PP
  1639. In the current implementation, new canvases are not given any
  1640. default behavior:  you'll have to execute explicit Tcl commands
  1641. to give the canvas its behavior.
  1642.  
  1643. .SH CREDITS
  1644. .PP
  1645. Tk's canvas widget is a blatant ripoff of ideas from Joel Bartlett's
  1646. \fIezd\fR program.  \fIEzd\fR provides structured graphics in a Scheme
  1647. environment and preceded canvases by a year or two.  Its simple
  1648. mechanisms for placing and animating graphical objects inspired the
  1649. functions of canvases.
  1650.  
  1651. .SH KEYWORDS
  1652. canvas, widget
  1653.